package org.qhhc.thread.endthread;

public class InterruptTests extends Thread{
    @Override
    public void run() {
        super.run();
        for (int i = 0; i < 200000; i++) {
            System.out.println("i="+i);
        }
    }

    public static void main(String[] args) {
        try{
            InterruptTests test = new InterruptTests();
            test.start();
            Thread.sleep(2000);
            test.interrupt();
        }catch(InterruptedException e){
            e.printStackTrace();
        }
    }
}
